"""
发送post请求
"""
import requests

# 有道词典直接拷贝链接 显示错误，他有反爬，将链接中_o去掉
# Request URL: http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule
url1 = "http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
}
data1 = {"i": "研究", "from": "AUTO", "to": "AUTO",
         "smartresult": "dict",
         "client": "fanyideskweb",
         "salt": "16045770434639",
         "sign": "6b82640fc6529bffe57198c3d509e709",
         "lts": "1604577043463",
         "bv": "0a19053d993d60580321f3e9b5652683",
         "doctype": "json",
         "version": "2.1",
         "keyfrom": "fanyi.web",
         "action": "FY_BY_REALTlME"
         }
response1 = requests.post(url1, headers=headers, data=data1)
print(response1.content.decode())

